<%@ page contentType="text/html;charset=UTF-8" language="java" buffer="100kb" autoFlush="true" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <title>主页</title>
    <%@include file="/front-end/views/common/head.jsp"%>
    <style>
        *{
            margin:0;
            padding:0;
            list-style: none;
            text-decoration: none;
        }
        #head{
            width:100%;
            height:100px;
            background-color: #e5e5e5;
        }
        #head li{
            margin-top: 40px;
            float:left;
            height:39px;
            line-height: 39px;
            padding:0 20px;
            text-align:center;
            cursor:pointer;
            list-style: none;
            font-size: 30px;
        }
        #head img{
            float:left;
            height:100px;
        }
        #main{
            /* background-color: red; */
            width:100%;
            height:1200px;
        }
        .current{
            background-color: #c81623;
            color:#fff;
        }
        .item{
            display:none;
        }
        #lunbotu{
            margin:0 auto;
            overflow: hidden;
            position: relative;
            width:1700px;
            height:450px;
            background-color: white;
        }
        #lunbotu ul{
            margin:0;
            padding:0;
            position: absolute;
            width:100000px;
        }
        #lunbotu ul li{
            float:left;
        }
        #lunbotu ul li img{
            width:1700px;
            height: 440px;
        }
        ol{
            position: absolute;
            top:380px;
            left:75%;
            z-index:999;
        }
        ol li{
            margin:10px;
            float:left;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background-color: purple;
        }
        .current{
            background-color: red;
        }

        .currentt{
            /* font-size: 300px; */
            color: red;
        }
        #left,
        #right{
            display: none;
            position: absolute;
            width: 50px;
            height: 50px;
            background-color: purple;
            top:40%;
            z-index:999;
        }
        #left{
            left:0;
        }
        #right{
            right:0;
        }
        #dianying{
            overflow: hidden;
            width:1300px;
            height:900px;
            margin:0 auto;
            /* background-color: green; */
        }
        #dianying ul li{
            float:left;
            padding:20px;
            font-size: 25px;
            cursor: pointer;
        }
        #dianying .itemone,.itemtwo{
            margin:0 auto;
            margin-top: 50px;
            width:1300px;
            height:800px;
            /* background-color: pink; */

        }
        #jieshao{
            width:200px;
            height:300px;
            background-color: purple;
        }
        #xian{
            width:100%;
            height:3px;
            float:left;
            margin-top: -20px;
            background-color: rgb(83, 81, 81);
        }
        .ying{
            position: relative;
            overflow: hidden;
            width: 220px;
            height: 300px;
            float:left;
            margin:20px;
            background-color: #e5e5e5;
        }
        .ying #top{
            /* float: left; */
            width: 220px;
            height:240px;
            background-color: red;
        }
        .ying #bottom{
            width: 220px;
            height:6px;
            /* float:left; */
            background-color: pink;
        }
        .ying img{

            width: 220px;
            height:240px;
        }
        .ying input{
            position: absolute;
            z-index:999;
            border: 1px solid #eb002a;
            width: 220px;
            height:60px;
            font-size: 20px;
            background-color: #eb002a;
            color:white;
            cursor: pointer;
        }
        .ying>button{
            position: absolute;
            z-index:999;
            border: 1px solid #eb002a;
            width: 220px;
            height:60px;
            font-size: 20px;
            background-color: #eb002a;
            color:white;
            cursor: pointer;
        }

        #cover{
            position: absolute;
            width: 220px;
            color:white;
            height: 300px;
            background-color:black;
            bottom:-300px;
            opacity: .6;
        }
        #cover p{
            margin:10px;
        }
        .ying:hover #cover{
            height:300px;
            bottom:0;
            text-decoration: none;
            transition: all .6s ease;
        }
        #guanying{
            overflow: hidden;
            width:1300px;
            height:900px;
            margin:0 auto;
            /* background-color: green; */
        }
        #guanying li{
            margin-top: 10px;
            float:left;
            height:39px;
            line-height: 39px;
            padding:0 20px;
            text-align:center;
            cursor:pointer;
            list-style: none;
            font-size: 25px;
        }
        .itemthree{
            margin:0 auto;
            margin-top:70px;
            width:1300px;
            height:800px;
            /* background-color: pink; */
        }
        #ccover{
            width: 220px;
            color:white;
            height: 310px;
            background-color:black;
            opacity: .6;
            margin-top: -250px;
            /* border-radius: 50%; */
        }
        #ccover h1{
            text-align: center;
            line-height: 280px;
            font-size: 50px;

        }
        .yying{
            position: relative;
            overflow: hidden;
            width: 220px;
            height: 300px;
            float:left;
            margin:20px;
            background-color: #e5e5e5;
        }
        .yying #top{
            /* float: left; */
            width: 220px;
            height:240px;
            background-color: red;
        }
        .yying #bottom{
            width: 220px;
            height:6px;
            /* float:left; */
            background-color: pink;
        }
        .yying img{

            width: 220px;
            height:240px;
        }
        .yying input{
            /* position: absolute; */
            /* z-index:999; */
            border: 1px solid #eb002a;
            width: 220px;
            height:60px;
            font-size: 20px;
            background-color: #eb002a;
            color:white;
            cursor: pointer;
        }
        #bijiao{
            width:1300px;
            height:300px;
            margin:0 auto;
            /* background-color: red; */
        }
        #bijiao-left{
            float:left;
            width:30%;
            height:200px;
            /* background-color: pink; */
        }
        #bijiao-left li{
            margin-bottom:10px;
            font-size: 20px ;
            border-bottom: 1px solid #e5e5e5;
        }
        #bijiao-right{
            float:right;
            width:65%;
            height:200px;
            /* background-color: green; */
        }
        #bijiao-right img{
            width:180px;
            margin-top: 20px;
            margin-left:27px
        }
        #bottom{
            width:100%;
            height:200px;
            background-color: #2b2b2b;
            color:white;
        }
        #bottom ul{
            float:left;
            margin-top: 20px;
            margin-left: 40px;
        }
        #big{
            font-size: 25px;
            font-weight: 500;
        }
        a{
            text-decoration: none;

        }
        a:hover{
            text-decoration: none;
        }
    </style>
</head>
<body>
<%--<div id="head">--%>
<%--    <img src="front-end/img/logo.png" alt="">--%>
<%--    <ul>--%>
<%--        <li class="current"><a href="index.jsp">首页</a></li>--%>
<%--        <li><a href="user/indexServlet?action=play">影片</a></li>--%>
<%--        <li><a href="user/indexServlet?action=myorder">我的订单</a></li>--%>
<%--        <%@include file="/front-end/views/common/login_success_menu.jsp"%>--%>
<%--    </ul>--%>
<%--</div>--%>
<%@include file="/front-end/views/common/user_menu.jsp"%>
<div id="main">
    <div class="item" style="display:block;" >
        <div id="lunbotu">
            <ul>
                <li><img src="front-end/img/6.jpg" ></img></li>
                <li><img src="front-end/img/6.jpg" ></img></li>
                <li><img src="front-end/img/6.jpg" ></img></li>
                <li><img src="front-end/img/6.jpg" ></img></li>
                <li><img src="front-end/img/6.jpg" ></img></li>
            </ul>
            <ol>
            </ol>
            <div id="left"></div>
            <div id="right"></div>
        </div>
        <div id="dianying">
            <ul class="one" >
                <li class="currentt">正在热映</li>
                <li>即将上映</li>
            </ul>
            <div id="xian"></div>
            <div class="itemone" style="display:block;">
                <%--        正在热映--%>
                <c:forEach items="${requestScope.page.items}" var="schedule" >
                    <div class="ying">
                        <div id="top">
<%--                            <img src="front-end/img/default.jpg" alt="">--%>
                            <img src="${requestScope.plays[schedule.play_id].play_image}" alt="">
                        </div>
                        <div id="bottom">
                            <input type="button" value="选座购票" onclick='location.href=("/ttms/user/indexServlet?action=chooseSeat&sched_id="+${schedule.sched_id})' />
                        </div>
                        <div id="cover">
                            <p>影片名称：${requestScope.plays[schedule.play_id-1].play_name}</p>
                            <p>放映时间：${schedule.sched_time}</p>
                            <p>影片时长：${requestScope.plays[schedule.play_id-1].play_length}</p>
                            <p>影片票价：${requestScope.plays[schedule.play_id-1].play_ticket_price}</p>
                        </div>
                    </div>
                </c:forEach>
            </div>

            <%--      即将上映--%>
            <div class="itemone" style="display:none;">
                <div class="ying">
                    <div id="top">
                        <img src="one.png" alt="">
                    </div>
                    <div id="bottom">
                        <input type="button" value="选座购票" onclick='location.href=("222.html")' />
                    </div>
                    <div id="cover">
                        <p>导演：宁浩, 徐峥</p>
                        <p>类型：喜剧,剧情</p>
                        <p>制片国家/地区：中国大陆</p>
                        <p>片长：153分钟</p>
                    </div>
                </div>
            </div>
        </div>

        <img src="../img/hahaha.png" style="width:100%;height:100px;float:left;margin-top: -500px;"alt="">
        <div id="bijiao">
            <div id="bijiao-left">
                <p>热门电影排行</p>
                <div id="xian" style="margin-top: 6px;"></div>
                <ul>
                    <li style="margin-top: 20px;">1.我和我的家乡</li>
                    <li>2.夺冠（中国女排）</li>
                    <li>3.一点就到家</li>
                    <li>4.姜子牙</li>
                    <li>5.喜宝</li>
                </ul>
            </div>
            <div id="bijiao-right">
                <p>热门预告片</p>
                <div id="xian" style="margin-top: 6px;">
                    <img src="front-end/img/a.png" alt="">
                    <img src="front-end/img/b.png" alt="">
                    <img src="front-end/img/c.png" alt="">
                    <img src="front-end/img/d.png" alt="">
                </div>
            </div>
        </div>
        <div id="bottom">
            <ul>
                <li id="big">选座购票流程</li>
                <li>1.选择影片和场次</li>
                <li>2.选择中意的座位</li>
                <li>3.支付并收到取票短信</li>
            </ul>
            <ul>
                <li id="big">取票流程</li>
                <li>1.收到取票短信</li>
                <li>2.影院自助取票</li>
                <li>3.短信重发方式</li>
            </ul>
            <ul>
                <li id="big">常见问题</li>
                <li>1.是否支持退换票</li>
                <li>2.填错手机号怎么办</li>
            </ul>
            <ul>
                <li id="big">协议规范</li>
                <li>1.用户服务协议</li>
                <li>2.食品管理规范</li>
                <li>3.隐私权政策</li>
                <li>4.退改签服务费规范</li>
            </ul>
            <img src="erone.png" alt="" style="margin-left: 500px;margin-top: 25px;">
            <img src="ertwo.png" alt="" style="margin-top: 25px;">
        </div>
    </div>
    <div class="item">
        <div id="dianying">
            <ul class="one" >
                <li class="currentt">正在热映</li>
            </ul>
            <div id="xian"></div>
            <div class="itemtwo">
                <div class="ying">
                    <div id="top">
                        <img src="one.png" alt="">
                    </div>
                    <div id="bottom">
                        <input type="button" value="选座购票" onclick='location.href=("111.html")' />
                    </div>
                    <div id="cover">
                        <p>导演：宁浩, 徐峥</p>
                        <p>类型：喜剧,剧情</p>
                        <p>制片国家/地区：中国大陆</p>
                        <p>片长：153分钟</p>
                    </div>
                </div>
                <div class="ying">
                    <div id="top">
                        <img src="one.png" alt="">
                    </div>
                    <div id="bottom">
                        <input type="button" value="选座购票" onclick='location.href=("111.html")' />
                    </div>
                    <div id="cover">
                        <p>导演：宁浩, 徐峥</p>
                        <p>类型：喜剧,剧情</p>
                        <p>制片国家/地区：中国大陆</p>
                        <p>片长：153分钟</p>
                    </div>
                </div>
                <div class="ying">
                    <div id="top">
                        <img src="one.png" alt="">
                    </div>
                    <div id="bottom">
                        <input type="button" value="选座购票" onclick='location.href=("111.html")' />
                    </div>
                    <div id="cover">
                        <p>导演：宁浩, 徐峥</p>
                        <p>类型：喜剧,剧情</p>
                        <p>制片国家/地区：中国大陆</p>
                        <p>片长：153分钟</p>
                    </div>
                </div>
                <div class="ying">
                    <div id="top">
                        <img src="one.png" alt="">
                    </div>
                    <div id="bottom">
                        <input type="button" value="选座购票" onclick='location.href=("111.html")' />
                    </div>
                    <div id="cover">
                        <p>导演：宁浩, 徐峥</p>
                        <p>类型：喜剧,剧情</p>
                        <p>制片国家/地区：中国大陆</p>
                        <p>片长：153分钟</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="item">
        <div id="guanying">
            <ul>
                <li class="currentt">未放映</li>
                <li>已放映</li>
            </ul>
            <div id="xian" style="margin-top: 5px;"></div>
            <div class="itemthree" style="display:block;">
                <div>
                    <div class="ying">
                        <div id="top">
                            <img src="one.png" alt="">
                        </div>
                        <div id="bottom">
                            <a href="orderdetail.html">
                                <input type="button" value="点击查看详情">
                            </a>
                        </div>
                        <div id="cover">
                            <p>导演：宁浩, 徐峥</p>
                            <p>类型：喜剧,剧情</p>
                            <p>制片国家/地区：中国大陆</p>
                            <p>片长：153分钟</p>
                        </div>
                    </div>
                    <div class="ying">
                        <div id="top">
                            <img src="one.png" alt="">
                        </div>
                        <div id="bottom">
                            <a href="orderdetail.html">
                                <input type="button" value="点击查看详情">
                            </a>
                        </div>
                        <div id="cover">
                            <p>导演：宁浩, 徐峥</p>
                            <p>类型：喜剧,剧情</p>
                            <p>制片国家/地区：中国大陆</p>
                            <p>片长：153分钟</p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="itemthree" style="display:none;">
                <div>
                    <div class="yying">
                        <div id="top">
                            <img src="one.png" alt="">
                        </div>
                        <div id="bottom">
                            <a href="orderdetail.html">
                                <input type="button" value="点击查看详情">
                            </a>
                        </div>
                        <div id="ccover">
                            <h1>已放映</h1>
                        </div>
                    </div>
                    <div class="yying">
                        <div id="top">
                            <img src="one.png" alt="">
                        </div>
                        <div id="bottom">
                            <a href="orderdetail.html">
                                <input type="button" value="点击查看详情">
                            </a>
                        </div>
                        <div id="ccover">
                            <h1>已放映</h1>
                        </div>
                    </div>
                    <div class="yying">
                        <div id="top">
                            <img src="one.png" alt="">
                        </div>
                        <div id="bottom">
                            <a href="orderdetail.html">
                                <input type="button" value="点击查看详情">
                            </a>
                        </div>
                        <div id="ccover">
                            <h1>已放映</h1>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    var lis = document.getElementById('head').querySelectorAll('li');
    var items = document.getElementById('main').querySelectorAll('.item');

    for(var i = 0;i<lis.length;i++){
        lis[i].setAttribute('index',i);
        lis[i].onclick = function (){
            for(var i =0;i<lis.length;i++){
                lis[i].className = '';
            }
            this.className = 'current';
            var index = this.getAttribute('index');
            for(var i = 0;i<items.length;i++){
                items[i].style.display = 'none';
            }
            items[index].style.display = 'block';
        }
    }
    window.addEventListener('load',function(){
        var box = document.querySelector('#lunbotu');
        var ul = box.querySelector('ul');
        var uli = box.querySelectorAll('li');
        var img = document.querySelector('img');
        var ol = document.querySelector('ol');
        var left = document.querySelector('#left');
        var right = document.querySelector('#right');
        var boxWidth = box.offsetWidth;


        //box
        box.addEventListener('mouseenter',function(){
            left.style.display = 'block';
            right.style.display = 'block';
            clearInterval(timer);
        })
        box.addEventListener('mouseleave',function(){
            left.style.display = 'none';
            right.style.display = 'none';
            timer = setInterval(function(){
                right.click();
            },2000);
        })



        //小圈圈
        for(var i = 0;i<uli.length;i++){
            var oli = document.createElement('li');
            ol.appendChild(oli);
            oli.setAttribute('index',i);
            oli.addEventListener('click',function(){
                for(var i = 0;i<ol.children.length;i++){
                    ol.children[i].className='';
                }
                this.className = 'current';

                var index = this.getAttribute('index');
                circle = index;
                num = index;
                animate(ul,-index*boxWidth);
            })
        }
        ol.children[0].className = 'current';
        var first = ul.children[0].cloneNode(true);
        ul.appendChild(first);


        //左右键
        var num = 0;
        var circle = 0;
        right.addEventListener('click',function(){
            if(num ==ul.children.length-1){
                ul.style.left = 0;
                num = 0;
            }
            num++;
            animate(ul,-num * boxWidth);


            circle++;
            if(circle == ul.children.length-1){
                circle =0;
            }
            for(var i = 0;i<ol.children.length;i++){
                ol.children[i].className = '';
            }
            ol.children[circle].className='current';


        })
        left.addEventListener('click',function(){
            if(num == 0){
                ul.style.left = (ul.children.length-1)*boxWidth;
            }
            num--;

            circle--;
            if(circle <0){
                circle = ol.children.length -1;
            }
            for(var i = 0;i<ol.children.length;i++){
                ol.children[i].className = '';
            }
            ol.children[circle].className='current';
            animate(ul,-num*boxWidth);
        })
        var timer = setInterval(function(){
            right.click();
        },8000)



        function animate(obj,target){
            clearInterval(obj.timer);
            obj.timer = setInterval(function(){
                var step = (target - obj.offsetLeft) / 10;
                step = step > 0? Math.ceil(step) : Math.floor(step);
                if(obj.offsetLeft == target){
                    clearInterval(obj.timer);
                }
                obj.style.left = obj.offsetLeft + step + 'px';
            },20);
        }



    })

    var dianying = document.querySelector('#dianying');
    var li = dianying.querySelectorAll('li');
    var itemone = document.querySelectorAll('.itemone');
    for(var i = 0;i<li.length;i++){
        li[i].setAttribute('index',i);
        li[i].onclick = function (){
            for(var i =0;i<li.length;i++){
                li[i].className = '';
            }
            this.className = 'currentt';
            var index = this.getAttribute('index');
            for(var i = 0;i<itemone.length;i++){
                itemone[i].style.display = 'none';
            }
            itemone[index].style.display = 'block';
        }
    }
    var guanying = document.querySelector('#guanying');
    var lili = guanying.querySelectorAll('li');
    var itemthree = document.querySelectorAll('.itemthree');
    for(var i = 0;i<lili.length;i++){
        lili[i].setAttribute('index',i);
        lili[i].onclick = function (){
            for(var i =0;i<lili.length;i++){
                lili[i].className = '';
            }
            this.className = 'currentt';
            var index = this.getAttribute('index');
            for(var i = 0;i<itemthree.length;i++){
                itemthree[i].style.display = 'none';
            }
            itemthree[index].style.display = 'block';
        }
    }
</script>
</html>
